package com.myspring.service.impl;

import com.myspring.service.UserService;
import org.springframework.beans.factory.annotation.Configurable;
import org.springframework.beans.factory.config.ConfigurableBeanFactory;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Service;

import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;
import java.sql.SQLOutput;

/**
 * ClassName: UserServiceImpl05
 * Package: com.myspring.service.impl
 * Description:
 *
 * @Author 刘英杰
 * @Create 2024/12/18 20:05
 * @Version 1.0
 */

@Service
//@Scope(ConfigurableBeanFactory.SCOPE_PROTOTYPE) //默认是单例
public class UserServiceImpl05 implements UserService {
    public UserServiceImpl05() {
        System.out.println(this + "构造方法");
    }

    @PostConstruct
    public void init() {
        System.out.println(this + "初始化");
    }

    @PreDestroy
    public void destroy() {
        System.out.println(this + "销毁");
    }
}
